//
// Created by hjie on 23-6-22.
//

#pragma once

#include <string>
#include <memory>
#include <vector>
#include <map>
#include <set>
#include <thread>
#include <functional>

class WebSocket;
class RoomManager;
class SignalThreadPool;

class ServerManager
{
public:
    static ServerManager * Instance()
    {
        static ServerManager * manager = new ServerManager();
        return manager;
    }
public:
    ServerManager();
    ~ServerManager();
    int Start();
    int Stop();
    void OnThread();
private:
    std::thread m_main_thread;
    std::map<int, WebSocket*> m_port_server_map;
    std::vector<std::thread>  m_thread_vec;
public:
    RoomManager * m_room_manager;
    std::shared_ptr<SignalThreadPool> m_signal_thread_pool;
};


